package com.syh.jn.scm.service.api.supplier.purchase;


import cn.redscarf.commons.wrapper.Wrapper;
import com.syh.jn.scm.dto.supplier.purchase.*;
import com.syh.jn.scm.dto.support.FilesDto;
import com.syh.jn.scm.service.core.BaseService;

import java.util.List;
import java.util.Map;

/**
 * 采购订单接口
 */
public interface PurchaseOrderService extends BaseService<PurchaseOrderSto, PurchaseOrderMto, PurchaseOrderVo, Long> {

  /**
   * 根据id获取明细
   *
   * @param id
   * @return
   */
  List<PurchaseOrderItemVo> getItemsByPurchaseOrderId(Long id);

  /**
   * 根据ids获取明细
   *
   * @param ids
   * @return
   */
  List<PurchaseOrderItemVo> getItemsByPurchaseOrderIds(Long[] ids);

  /**
   * 根据goodsId拿到订单明细对象
   *
   * @param goodsId
   * @param id
   * @return
   */
  PurchaseOrderItemVo getByGoodsId(Long goodsId, Long id);

  /**
   * 取消订单
   *
   * @param id
   */
  void cancel(Long id);

  /**
   * 上传图片
   *
   * @param dto
   */
  public void uploadImages(FilesDto dto);

  /**
   * 批量保存
   *
   * @param mapStoList
   * @return
   */
  List<Long> batchSaveWithVirtualId(List<Map<String, String>> mapStoList);

  /**
   * 确认订单
   *
   * @param id 订单id
   */
  void confirmOrder(Long id);

  /**
   * 采购统计金额
   *
   * @param wrapper
   * @return
   */
  PurStatisticalAmountVo statisticalAmount(Wrapper wrapper);

  PurStatisticalAmountVo statisticalAmountByOrder(Wrapper we);

  /**
   * 纠正订单物流相关字段数据
   */
  void correctingLogisticsData();
}
